package com.authine.cloudpivot.engine.api.facade.dubbo;

import com.alibaba.dubbo.config.annotation.Service;
import com.authine.cloudpivot.engine.api.facade.QueryLogsFacade;
import com.authine.cloudpivot.engine.service.impl.helper.JPANativeQuery;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;

import javax.annotation.Nullable;
import java.util.List;
import java.util.Map;

/**
 * @ClassName QueryLogsFacadeImpl
 * @Description TODO
 * @author fengjie
 * @createTime 2022/4/21 15:31
 * @version 1.0.0
 */
@DubboService(version = "1.00")
public class QueryLogsFacadeImpl implements QueryLogsFacade {
    @Autowired
    private JPANativeQuery jpaNativeQuery;

    @Override
    public int getCount(String countSql, @Nullable Map<String, Object> params) {
        return jpaNativeQuery.getCount(countSql, params);
    }

    @Override
    public List getList(String querySql, @Nullable Pageable pageable, @Nullable Map<String, Object> params) {
        return jpaNativeQuery.getList(Map.class, querySql, pageable, params);
    }
}
